package com.example.mp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.mp.pojo.User;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * @BelongsProject: MP
 * @BelongsPackage: com.example.mp.mapper
 * @Author: wyj
 * @CreateTime: 2024-05-14  14:59
 * @Description:
 * @Version: 1.0
 */
@Repository // 类或接口标识成持久层文件
public interface UserMapper extends BaseMapper<User> {

    @MapKey("id") // 作为map的key
    Map<String, Object> selectMapById(Long id);

    // 通过年龄查询用户信息并分页
    Page<User> selectPageVo(@Param("page") Page<User> page, @Param("age") Integer age);

}
